<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function fu(){
            var result = document.getElementById('ip1');
            var level = document.getElementById('ip2');
            result =Number(result.value);
            if(result>=0 && result<=100){
                    if(result<60){
                    level.value = "不合格";
                }else if(result<70){
                    level.value = "及格";
                }else if(result<85){
                    level.value = "良";
                }else if(result<=100){
                    level.value = "优";
                }
            }else{
                alert('成绩只能为0-100的数');
            }
            
        }
    </script>
</body>
</head>
<body>
    请输出成绩：
    <input type="text" id="ip1">
    <button onclick="fu()">查看</button>
    <input type="text" id="ip2">
    
</html>